home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / awksrc.zip / MUNGEC~1 < prev    next >
Text File  |  1991-07-02  |  484b  |  21 lines

  1. #! /bin/sh
  2.  
  3. # stdout is normally config.h
  4.  
  5. case $# in
  6. 2)    ;;
  7. *)    echo "Usage: mungeconf sysfile distfile" >&2 ; exit 2 ;;
  8. esac
  9.  
  10. sed '/^#/d; /^MAKE_*/d' $1 |    # strip comments and Makefile stuff
  11. sed '1s:.*:s~__SYSTEM__~&~:
  12. 2,$s:^\([^     ]*\)[     ].*:s~^/\\* #define[     ]*\1.*~#define    &~:' >sedscr
  13.  
  14. sed -f sedscr $2
  15.  
  16. echo
  17. echo '/* anything that follows is for system-specific short-term kludges */'
  18. grep '^#define' $1        # for system-specific short-term kludges
  19.  
  20. rm -f sedscr
  21.